The Component Manager provides routines that allow your application to search for components. Your application specifies the search criteria in a component description record. (See "Data Structures for Applications," for information about the component description record.) Based on the values you specify in fields of the component description record, the Component Manager attempts to find components that meet the needs of your application.
You can use the CountComponents function to determine the number of components that match a component description. Use the FindNextComponent function to find an individual component that matches a description.
You can use the GetComponentListModSeed function to determine whether the list of registered components has changed.
The FindNextComponent function returns the component identifier for the next registered component that meets the selection criteria specified by your application. You specify the selection criteria in a component description record.
Your application can use the component identifier returned by this function to get more information about the component or to open the component.
FUNCTION FindNextComponent (aComponent: Component;
looking: ComponentDescription)
: Component;
The FindNextComponent function returns the component identifier of a component that meets the search criteria. FindNextComponent returns a function result of 0 when there are no more matching components.
Use the GetComponentInfo function, described on GetComponentInfo , to retrieve more information about a component. To open a component, use the OpenDefaultComponent or OpenComponent function, described on OpenDefaultComponent and OpenComponent , respectively. See The Component Description Record for information on the component description record.
See Listing 1 for an example of searching for a specific component.
Your application can use the CountComponents function to determine the number of registered components that meet your selection criteria. You specify the selection criteria in a component description record. The CountComponents function returns the number of components that meet those search criteria.
FUNCTION CountComponents (looking: ComponentDescription): LongInt;
The CountComponents function returns a long integer containing the number of components that meet the specified search criteria.
See The Component Description Record for information on the component description record.
The GetComponentListModSeed function allows you to determine if the list of registered components has changed. This function returns the value of the component registration seed number. By comparing this value to values previously returned by the this function, you can determine whether the list has changed. Your application may use this information to rebuild its internal component lists or to trigger other activity that is necessary whenever new components are available.
FUNCTION GetComponentListModSeed: LongInt;